package com.biovr.backend.config;

import com.mongodb.MongoClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.data.mongodb.core.MongoTemplate;

/**
 * Created by jnmcl on 2017/8/5.
 */
//@Configuration
public class MongoConfig {
  @Value("${spring.data.mongodb.database}")
  private String database;
  public @Bean
  MongoClient mongoClient() {
    return new MongoClient("localhost");
  }

  public @Bean
  MongoTemplate mongoTemplate() {
    return new MongoTemplate(mongoClient(), database);
  }

}
